FROM reg.deeproute.ai/deeproute-public/golang:1.19.3-alpine3.16 as builder

ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GOFLAGS=-mod=vendor
ENV APP_USER app
ENV APP_HOME /go/src/microservices
ENV GOPROXY=https://goproxy.cn,direct

RUN mkdir /eci-forward
ADD . /eci-forward
WORKDIR /eci-forward

RUN go mod vendor
RUN go build -o eci-forward

FROM alpine:3.11 as runner
COPY --from=builder /eci-forward/eci-forward /eci-forward/eci-forward
WORKDIR /eci-forward
CMD ["/eci-forward/eci-forward"]

EXPOSE 4563
